import http from '@/http'
import type { Result } from '@/http/type'
import type { DashboardStats, RecentActivity, ChartData, ModuleStats } from './type.ts'

/**
 * 获取首页统计数据
 */
export const getDashboardStatsApi = () => {
  return http.get<Result<DashboardStats>>('/dashboard/stats')
}

/**
 * 获取最近操作记录
 */
export const getRecentActivitiesApi = () => {
  return http.get<Result<RecentActivity[]>>('/dashboard/activities')
}

/**
 * 获取图表数据
 */
export const getChartDataApi = (period: string) => {
  return http.get<Result<ChartData>>('/dashboard/chart', { period })
}

/**
 * 获取核价模块统计
 */
export const getModuleStatsApi = () => {
  return http.get<Result<ModuleStats>>('/dashboard/moduleStats')
} 